/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package data;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Mr. Tam
 */
@Entity
@Table(name = "Complaint_Status")
@NamedQueries({
    @NamedQuery(name = "ComplaintStatus.findAll", query = "SELECT c FROM ComplaintStatus c"),
    @NamedQuery(name = "ComplaintStatus.findByComplaintStatusId", query = "SELECT c FROM ComplaintStatus c WHERE c.complaintStatusId = :complaintStatusId"),
    @NamedQuery(name = "ComplaintStatus.findByComplaintStatusName", query = "SELECT c FROM ComplaintStatus c WHERE c.complaintStatusName = :complaintStatusName")})
public class ComplaintStatus implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "complaint_status_id")
    private Integer complaintStatusId;
    @Column(name = "complaint_status_name")
    private String complaintStatusName;
    @OneToMany(mappedBy = "complaintStatus")
    private List<Complaint> complaintList;

    public ComplaintStatus() {
    }

    public ComplaintStatus(Integer complaintStatusId) {
        this.complaintStatusId = complaintStatusId;
    }

    public Integer getComplaintStatusId() {
        return complaintStatusId;
    }

    public void setComplaintStatusId(Integer complaintStatusId) {
        this.complaintStatusId = complaintStatusId;
    }

    public String getComplaintStatusName() {
        return complaintStatusName;
    }

    public void setComplaintStatusName(String complaintStatusName) {
        this.complaintStatusName = complaintStatusName;
    }

    public List<Complaint> getComplaintList() {
        return complaintList;
    }

    public void setComplaintList(List<Complaint> complaintList) {
        this.complaintList = complaintList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (complaintStatusId != null ? complaintStatusId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ComplaintStatus)) {
            return false;
        }
        ComplaintStatus other = (ComplaintStatus) object;
        if ((this.complaintStatusId == null && other.complaintStatusId != null) || (this.complaintStatusId != null && !this.complaintStatusId.equals(other.complaintStatusId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "data.ComplaintStatus[complaintStatusId=" + complaintStatusId + "]";
    }

}
